{% capture theme_settings_link %}<a href="admin/themes/{{ theme.id }}/settings">{{ 'layout.footer.theme_settings' | t }}</a>{% endcapture %}

<footer class="site-footer small--text-center" role="contentinfo">

  <div class="wrapper">

    <div class="grid">

      {% if settings.footer_quicklinks_enable %}
        <div class="grid-item medium--one-half large--three-twelfths">
          <h3>{{ 'layout.footer.quick_links' | t }}</h3>
          <ul>
            {% for link in linklists[settings.footer_quicklinks_linklist].links %}
              <li><a href="{{ link.url }}">{{ link.title }}</a></li>
            {% else %}
              {% capture theme_settings_footer_linklist_path %}<strong>Footer</strong> > <strong>Quick links link list</strong>{% endcapture %}
              {{ 'layout.footer.instructions_for_linklist_html' | t: theme_settings_link: theme_settings_link, theme_settings_footer_linklist_path: theme_settings_footer_linklist_path }}
            {% endfor %}
          </ul>
        </div>
      {% endif %}

      {% if settings.footer_content_enable %}
      <div class="grid-item medium--one-half large--five-twelfths">
        <h3>{{ 'layout.footer.get_in_touch' | t }}</h3>
        <p>
          {% if settings.footer_content_text != blank %}
            {{ settings.footer_content_text }}
          {% else %}
            {{ 'layout.footer.instructions_for_text_content_html' | t: theme_settings_link: theme_settings_link }}
          {% endif %}
        </p>

        {% if settings.footer_social_enable %}
          <ul class="inline-list social-icons">
            {% if settings.social_twitter_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_twitter_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Twitter' | escape }}">
                  <span class="icon icon-twitter" aria-hidden="true"></span>
                  <span class="fallback-text">Twitter</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_facebook_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_facebook_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Facebook' | escape }}">
                  <span class="icon icon-facebook" aria-hidden="true"></span>
                  <span class="fallback-text">Facebook</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_pinterest_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_pinterest_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Pinterest' | escape }}">
                  <span class="icon icon-pinterest" aria-hidden="true"></span>
                  <span class="fallback-text">Pinterest</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_google_plus_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_google_plus_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Google' | escape }}">
                  <span class="icon icon-google" aria-hidden="true"></span>
                  <span class="fallback-text">Google</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_instagram_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_instagram_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Instagram' | escape }}">
                  <span class="icon icon-instagram" aria-hidden="true"></span>
                  <span class="fallback-text">Instagram</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_tumblr_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_tumblr_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Tumblr' | escape }}">
                  <span class="icon icon-tumblr" aria-hidden="true"></span>
                  <span class="fallback-text">Tumblr</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_youtube_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_youtube_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'YouTube' | escape }}">
                  <span class="icon icon-youtube" aria-hidden="true"></span>
                  <span class="fallback-text">YouTube</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_vimeo_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_vimeo_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Vimeo' | escape }}">
                  <span class="icon icon-vimeo" aria-hidden="true"></span>
                  <span class="fallback-text">Vimeo</span>
                </a>
              </li>
            {% endif %}
            {% if settings.social_fancy_link != blank %}
              <li>
                <a class="icon-fallback-text" href="{{ settings.social_fancy_link }}" title="{{ 'layout.footer.store_on_social_network' | t: store_name: shop.name, social_network: 'Fancy' | escape }}">
                  <span class="icon icon-fancy" aria-hidden="true"></span>
                  <span class="fallback-text">Fancy</span>
                </a>
              </li>
            {% endif %}
          </ul>
        {% endif %}
      </div>
      {% endif %}

      {% if settings.footer_newsletter_enable %}
      <div class="grid-item large--one-third">
        <h3>{{ 'layout.footer.newsletter_title' | t }}</h3>
        {% include 'newsletter-form' %}
      </div>
      {% endif %}
    </div>

    <hr class="hr--small">

    <div class="grid">
      <div class="grid-item{% unless shop.enabled_payment_types == empty %} large--two-fifths{% endunless %}">
        {% if settings.footer_legallinks_enable %}
          <ul class="legal-links inline-list">
            {% for link in linklists[settings.footer_legallinks_linklist].links %}
              <li><a href="{{ link.url }}">{{ link.title }}</a></li>
            {% endfor %}
          </ul>
        {% endif %}
        <ul class="legal-links inline-list">
          <li>
            &copy; {{ 'now' | date: "%Y" }} {{ shop.name }}
          </li>
          <li>
            {{ powered_by_link }}
          </li>
        </ul>
      </div>

      {% unless shop.enabled_payment_types == empty %}
        <div class="grid-item large--three-fifths large--text-right">
          <ul class="inline-list payment-icons">
            {% for type in shop.enabled_payment_types %}
              <li>
                <span class="icon-fallback-text">
                  <span class="icon icon-{{ type }}" aria-hidden="true"></span>
                  <span class="fallback-text">{{ type | replace: '_',' ' }}</span>
                </span>
              </li>
            {% endfor %}
          </ul>
        </div>
      {% endunless %}

    </div>

  </div>

</footer>